package cc.ilzy.mall.coupon.controller;

import cc.ilzy.mall.api.controller.ICouponController;
import cc.ilzy.mall.coupon.service.ICouponService;
import cc.ilzy.mall.model.vo.CouponVO;
import cc.ilzy.mall.utils.ApiResponse;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ilzy
 * @since 2025-07-06
 */
@RestController
public class CouponController implements ICouponController {
    @Autowired
    private ICouponService couponService;

    @Override
    public ApiResponse<IPage<CouponVO>> queryPage(Integer pageNum, Integer pageSize, Long couponId, String category) {
        IPage<CouponVO> page = couponService.queryCouponPage(pageNum, pageSize,  couponId,  category);
        return ApiResponse.success(page);
    }
}
